
module.exports = require('angular')
    .module('app.router', [
        // 路由模块
        require('angular-ui-router')
    ])
    .config(function ($urlRouterProvider, $stateProvider) {
        $urlRouterProvider.when("", "/");
        $stateProvider
            .state('views', {
                url: "/",
                views: {
                    'views.index': {
                        templateProvider: function ($q) {
                            var defer = $q.defer();
                            require.ensure([], function () {
                                defer.resolve(require(__VIEWS__ + '/index/template.html'));
                            })
                            return defer.promise;
                        }
                    },
                    'views.infomation': {
                        templateProvider: function ($q) {
                            var defer = $q.defer();
                            require.ensure([], function () {
                                defer.resolve(require(__VIEWS__ + '/infomation/template.html'));
                            })
                            return defer.promise;
                        }
                    },
                    'views.occupation': {
                        templateProvider: function ($q) {
                            var defer = $q.defer();
                            require.ensure([], function () {
                                defer.resolve(require(__VIEWS__ + '/occupation/template.html'));
                            })
                            return defer.promise;
                        }
                    },
                    'views.datas': {
                        templateProvider: function ($q) {
                            var defer = $q.defer();
                            require.ensure([], function () {
                                defer.resolve(require(__VIEWS__ + '/datas/template.html'));
                            })
                            return defer.promise;
                        }
                    },
                    'views.pictures': {
                        templateProvider: function ($q) {
                            var defer = $q.defer();
                            require.ensure([], function () {
                                defer.resolve(require(__VIEWS__ + '/pictures/template.html'));
                            })
                            return defer.promise;
                        }
                    },
                }
            })
    })
